class BasicInfo {

    String name
    
    MainCategory mainCategory
    
    SubCategory subCategory
    
    String status
    
    String notes
    
    Date startDateTime = new Date()
    
    static hasMany = [textinfos:TextInfo] 
      
    static constraints = {
        
        name(maxLength:50,blank:false) 
        
        status(inList:['draft','new', 'run', 'close','cancel'],blank:false) 
        
        notes(maxLength:500) 
                
        mainCategory(blank:false)
        subCategory(blank:false)
        
    }
    
    String toString() {"${this.mainCategory?.value}.${this.subCategory?.value}:${this.name}   (${this.status})" }
}
